#include "UpperSetKNXMacCmd.h"

UpperSetKNXMacCmd::UpperSetKNXMacCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::CloudProtocol;
    this->m_functionCode = FunctionCode;
}
Package UpperSetKNXMacCmd::toPackage()
{
    Package package;
    return package;
}

void UpperSetKNXMacCmd::unPackage(Package package)
{
    m_cmdId = package.id();
    QByteArray body;

    body = decrypt(package.body(),KeyType::AES);



    m_KNXMac = body.mid(0,2).toHex().toInt(0,16);

    qDebug()<<"UpperSetKNXMacCmd::unPackage "<<m_KNXMac;

}

quint16 UpperSetKNXMacCmd::KNXMac() const
{
    return m_KNXMac;
}
void UpperSetKNXMacCmd::setKNXMac(const quint16 mac)
{
    m_KNXMac = mac;
}
